home *** CD-ROM | disk | FTP | other *** search
/ Micromanía 92 / CDMM92_1.ISO / SOF 2 SDK / sof2sdk-101.msi / _92D6AC311BB48EBA344BBABC89DA6AB0 / _8D893F59ACB7490FB2C4737A14F5E285 < prev    next >
Encoding:
Text File  |  2002-06-05  |  20.0 KB  |  702 lines

  1. // Copyright (C) 2001-2002 Raven Software
  2. //
  3. #include "ui_local.h"
  4.  
  5. // this file is only included when building a dll
  6. // syscalls.asm is included instead when building a qvm
  7.  
  8. static int (QDECL *syscall)( int arg, ... ) = (int (QDECL *)( int, ...))-1;
  9.  
  10. void dllEntry( int (QDECL *syscallptr)( int arg,... ) ) {
  11.     syscall = syscallptr;
  12. }
  13.  
  14. int PASSFLOAT( float x ) {
  15.     float    floatTemp;
  16.     floatTemp = x;
  17.     return *(int *)&floatTemp;
  18. }
  19.  
  20. void trap_Print( const char *string ) {
  21.     syscall( UI_PRINT, string );
  22. }
  23.  
  24. void trap_Error( const char *string ) {
  25.     syscall( UI_ERROR, string );
  26. }
  27.  
  28. int trap_Milliseconds( void ) {
  29.     return syscall( UI_MILLISECONDS ); 
  30. }
  31.  
  32. void trap_Cvar_Register( vmCvar_t *cvar, const char *var_name, const char *value, int flags, float MinValue, float MaxValue ) {
  33.     syscall( UI_CVAR_REGISTER, cvar, var_name, value, flags, PASSFLOAT(MinValue), PASSFLOAT(MaxValue) );
  34. }
  35.  
  36. void trap_Cvar_Update( vmCvar_t *cvar ) {
  37.     syscall( UI_CVAR_UPDATE, cvar );
  38. }
  39.  
  40. void trap_Cvar_Set( const char *var_name, const char *value ) {
  41.     syscall( UI_CVAR_SET, var_name, value );
  42. }
  43.  
  44. float trap_Cvar_VariableValue( const char *var_name ) {
  45.     int temp;
  46.     temp = syscall( UI_CVAR_VARIABLEVALUE, var_name );
  47.     return (*(float*)&temp);
  48. }
  49.  
  50. void trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int bufsize ) {
  51.     syscall( UI_CVAR_VARIABLESTRINGBUFFER, var_name, buffer, bufsize );
  52. }
  53.  
  54. void trap_Cvar_SetValue( const char *var_name, float value ) {
  55.     syscall( UI_CVAR_SETVALUE, var_name, PASSFLOAT( value ) );
  56. }
  57.  
  58. void trap_Cvar_Reset( const char *name ) {
  59.     syscall( UI_CVAR_RESET, name ); 
  60. }
  61.  
  62. void trap_Cvar_Create( const char *var_name, const char *var_value, int flags ) {
  63.     syscall( UI_CVAR_CREATE, var_name, var_value, flags );
  64. }
  65.  
  66. void trap_Cvar_InfoStringBuffer( int bit, char *buffer, int bufsize ) {
  67.     syscall( UI_CVAR_INFOSTRINGBUFFER, bit, buffer, bufsize );
  68. }
  69.  
  70. int trap_Argc( void ) {
  71.     return syscall( UI_ARGC );
  72. }
  73.  
  74. void trap_Argv( int n, char *buffer, int bufferLength ) {
  75.     syscall( UI_ARGV, n, buffer, bufferLength );
  76. }
  77.  
  78. void trap_Cmd_ExecuteText( int exec_when, const char *text ) {
  79.     syscall( UI_CMD_EXECUTETEXT, exec_when, text );
  80. }
  81.  
  82. int trap_FS_FOpenFile( const char *qpath, fileHandle_t *f, fsMode_t mode ) {
  83.     return syscall( UI_FS_FOPENFILE, qpath, f, mode );
  84. }
  85.  
  86. void trap_FS_Read( void *buffer, int len, fileHandle_t f ) {
  87.     syscall( UI_FS_READ, buffer, len, f );
  88. }
  89.  
  90. void trap_FS_Write( const void *buffer, int len, fileHandle_t f ) {
  91.     syscall( UI_FS_WRITE, buffer, len, f );
  92. }
  93.  
  94. void trap_FS_FCloseFile( fileHandle_t f ) {
  95.     syscall( UI_FS_FCLOSEFILE, f );
  96. }
  97.  
  98. int trap_FS_GetFileList(  const char *path, const char *extension, char *listbuf, int bufsize ) {
  99.     return syscall( UI_FS_GETFILELIST, path, extension, listbuf, bufsize );
  100. }
  101.  
  102. qhandle_t trap_R_RegisterModel( const char *name ) {
  103.     return syscall( UI_R_REGISTERMODEL, name );
  104. }
  105.  
  106. qhandle_t trap_R_RegisterSkin( const char *name ) {
  107.     return syscall( UI_R_REGISTERSKIN, name );
  108. }
  109.  
  110. qhandle_t trap_R_RegisterFont(const char *fontName) {
  111.     return (qhandle_t)syscall( UI_R_REGISTERFONT, fontName );
  112. }
  113.  
  114. qhandle_t trap_R_RegisterShaderNoMip( const char *name ) {
  115.     return syscall( UI_R_REGISTERSHADERNOMIP, name );
  116. }
  117.  
  118. void trap_R_ClearScene( void ) {
  119.     syscall( UI_R_CLEARSCENE );
  120. }
  121.  
  122. void trap_R_AddRefEntityToScene( const refEntity_t *re ) {
  123.     syscall( UI_R_ADDREFENTITYTOSCENE, re );
  124. }
  125.  
  126. void trap_R_AddPolyToScene( qhandle_t hShader , int numVerts, const polyVert_t *verts ) {
  127.     syscall( UI_R_ADDPOLYTOSCENE, hShader, numVerts, verts );
  128. }
  129.  
  130. void trap_R_AddLightToScene( const vec3_t org, float intensity, float r, float g, float b ) {
  131.     syscall( UI_R_ADDLIGHTTOSCENE, org, PASSFLOAT(intensity), PASSFLOAT(r), PASSFLOAT(g), PASSFLOAT(b) );
  132. }
  133.  
  134. void trap_R_RenderScene( const refdef_t *fd ) {
  135.     syscall( UI_R_RENDERSCENE, fd );
  136. }
  137.  
  138. void trap_R_SetColor( const float *rgba ) {
  139.     syscall( UI_R_SETCOLOR, rgba );
  140. }
  141.  
  142. void trap_R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, const float* color, qhandle_t hShader ) {
  143.     syscall( UI_R_DRAWSTRETCHPIC, PASSFLOAT(x), PASSFLOAT(y), PASSFLOAT(w), PASSFLOAT(h), PASSFLOAT(s1), PASSFLOAT(t1), PASSFLOAT(s2), PASSFLOAT(t2), color, hShader );
  144. }
  145.  
  146. void    trap_R_ModelBounds( clipHandle_t model, vec3_t mins, vec3_t maxs ) {
  147.     syscall( UI_R_MODELBOUNDS, model, mins, maxs );
  148. }
  149.  
  150. int        trap_R_GetTextWidth  ( const char* text, qhandle_t font, float scale, int limit )
  151. {
  152.     return syscall ( UI_R_GETTEXTWIDTH, text, font, PASSFLOAT(scale), limit );
  153. }
  154.     
  155. int        trap_R_GetTextHeight ( const char* text, qhandle_t font, float scale, int limit )
  156. {
  157.     return syscall ( UI_R_GETTEXTHEIGHT, text, font, PASSFLOAT(scale), limit );
  158. }
  159.  
  160. void    trap_R_DrawText ( int x, int y, qhandle_t font, float scale, vec4_t color, const char* text, int limit, int flags )
  161. {
  162.     syscall ( UI_R_DRAWTEXT, x, y, font, PASSFLOAT(scale), color, text, limit, flags );
  163. }
  164.  
  165. void    trap_R_DrawTextWithCursor ( int x, int y, qhandle_t font, float scale, vec4_t color, const char* text, int limit, int flags, int cursorPos, char cursor )
  166. {
  167.     syscall ( UI_R_DRAWTEXTWITHCURSOR, x, y, font, PASSFLOAT(scale), color, text, limit, flags, cursorPos, cursor );
  168. }
  169.  
  170. void trap_UpdateScreen( qboolean IsLoading ) {
  171.     syscall( UI_UPDATESCREEN, IsLoading );
  172. }
  173.  
  174. int trap_CM_LerpTag( orientation_t *tag, clipHandle_t mod, int startFrame, int endFrame, float frac, const char *tagName ) {
  175.     return syscall( UI_CM_LERPTAG, tag, mod, startFrame, endFrame, PASSFLOAT(frac), tagName );
  176. }
  177.  
  178. void trap_S_StartLocalSound( sfxHandle_t sfx, int channelNum ) {
  179.     syscall( UI_S_STARTLOCALSOUND, sfx, channelNum );
  180. }
  181.  
  182. sfxHandle_t    trap_S_RegisterSound( const char *sample ) {
  183.     return syscall( UI_S_REGISTERSOUND, sample );
  184. }
  185.  
  186. void trap_Key_KeynumToStringBuf( int keynum, char *buf, int buflen ) {
  187.     syscall( UI_KEY_KEYNUMTOSTRINGBUF, keynum, buf, buflen );
  188. }
  189.  
  190. void trap_Key_GetBindingBuf( int keynum, char *buf, int buflen ) {
  191.     syscall( UI_KEY_GETBINDINGBUF, keynum, buf, buflen );
  192. }
  193.  
  194. void trap_Key_SetBinding( int keynum, const char *binding ) {
  195.     syscall( UI_KEY_SETBINDING, keynum, binding );
  196. }
  197.  
  198. qboolean trap_Key_IsDown( int keynum ) {
  199.     return syscall( UI_KEY_ISDOWN, keynum );
  200. }
  201.  
  202. qboolean trap_Key_GetOverstrikeMode( void ) {
  203.     return syscall( UI_KEY_GETOVERSTRIKEMODE );
  204. }
  205.  
  206. void trap_Key_SetOverstrikeMode( qboolean state ) {
  207.     syscall( UI_KEY_SETOVERSTRIKEMODE, state );
  208. }
  209.  
  210. void trap_Key_ClearStates( void ) {
  211.     syscall( UI_KEY_CLEARSTATES );
  212. }
  213.  
  214. int trap_Key_GetCatcher( void ) {
  215.     return syscall( UI_KEY_GETCATCHER );
  216. }
  217.  
  218. void trap_Key_SetCatcher( int catcher ) {
  219.     syscall( UI_KEY_SETCATCHER, catcher );
  220. }
  221.  
  222. void trap_GetClipboardData( char *buf, int bufsize ) {
  223.     syscall( UI_GETCLIPBOARDDATA, buf, bufsize );
  224. }
  225.  
  226. void trap_GetClientState( uiClientState_t *state ) {
  227.     syscall( UI_GETCLIENTSTATE, state );
  228. }
  229.  
  230. void trap_GetGlconfig( glconfig_t *glconfig ) {
  231.     syscall( UI_GETGLCONFIG, glconfig );
  232. }
  233.  
  234. int trap_GetConfigString( int index, char* buff, int buffsize ) {
  235.     return syscall( UI_GETCONFIGSTRING, index, buff, buffsize );
  236. }
  237.  
  238. int    trap_LAN_GetServerCount( int source ) {
  239.     return syscall( UI_LAN_GETSERVERCOUNT, source );
  240. }
  241.  
  242. void trap_LAN_GetServerAddressString( int source, int n, char *buf, int buflen ) {
  243.     syscall( UI_LAN_GETSERVERADDRESSSTRING, source, n, buf, buflen );
  244. }
  245.  
  246. void trap_LAN_GetServerInfo( int source, int n, char *buf, int buflen ) {
  247.     syscall( UI_LAN_GETSERVERINFO, source, n, buf, buflen );
  248. }
  249.  
  250. int trap_LAN_GetServerPing( int source, int n ) {
  251.     return syscall( UI_LAN_GETSERVERPING, source, n );
  252. }
  253.  
  254. int trap_LAN_GetPingQueueCount( void ) {
  255.     return syscall( UI_LAN_GETPINGQUEUECOUNT );
  256. }
  257.  
  258. int trap_LAN_ServerStatus( const char *serverAddress, char *serverStatus, int maxLen ) {
  259.     return syscall( UI_LAN_SERVERSTATUS, serverAddress, serverStatus, maxLen );
  260. }
  261.  
  262. void trap_LAN_SaveCachedServers() {
  263.     syscall( UI_LAN_SAVECACHEDSERVERS );
  264. }
  265.  
  266. void trap_LAN_LoadCachedServers() {
  267.     syscall( UI_LAN_LOADCACHEDSERVERS );
  268. }
  269.  
  270. void trap_LAN_ResetPings(int n) {
  271.     syscall( UI_LAN_RESETPINGS, n );
  272. }
  273.  
  274. void trap_LAN_ClearPing( int n ) {
  275.     syscall( UI_LAN_CLEARPING, n );
  276. }
  277.  
  278. void trap_LAN_GetPing( int n, char *buf, int buflen, int *pingtime ) {
  279.     syscall( UI_LAN_GETPING, n, buf, buflen, pingtime );
  280. }
  281.  
  282. void trap_LAN_GetPingInfo( int n, char *buf, int buflen ) {
  283.     syscall( UI_LAN_GETPINGINFO, n, buf, buflen );
  284. }
  285.  
  286. void trap_LAN_MarkServerVisible( int source, int n, qboolean visible ) {
  287.     syscall( UI_LAN_MARKSERVERVISIBLE, source, n, visible );
  288. }
  289.  
  290. int trap_LAN_ServerIsVisible( int source, int n) {
  291.     return syscall( UI_LAN_SERVERISVISIBLE, source, n );
  292. }
  293.  
  294. qboolean trap_LAN_UpdateVisiblePings( int source ) {
  295.     return syscall( UI_LAN_UPDATEVISIBLEPINGS, source );
  296. }
  297.  
  298. int trap_LAN_AddServer(int source, const char *name, const char *addr) {
  299.     return syscall( UI_LAN_ADDSERVER, source, name, addr );
  300. }
  301.  
  302. void trap_LAN_RemoveServer(int source, const char *addr) {
  303.     syscall( UI_LAN_REMOVESERVER, source, addr );
  304. }
  305.  
  306. int trap_LAN_CompareServers( int source, int sortKey, int sortDir, int s1, int s2 ) {
  307.     return syscall( UI_LAN_COMPARESERVERS, source, sortKey, sortDir, s1, s2 );
  308. }
  309.  
  310. int trap_MemoryRemaining( void ) {
  311.     return syscall( UI_MEMORY_REMAINING );
  312. }
  313.  
  314. void trap_GetCDKey( char *buf, int buflen ) {
  315.     syscall( UI_GET_CDKEY, buf, buflen );
  316. }
  317.  
  318. void trap_SetCDKey( char *buf ) {
  319.     syscall( UI_SET_CDKEY, buf );
  320. }
  321.  
  322. int trap_PC_AddGlobalDefine( char *define ) {
  323.     return syscall( UI_PC_ADD_GLOBAL_DEFINE, define );
  324. }
  325.  
  326. int trap_PC_LoadSource( const char *filename ) {
  327.     return syscall( UI_PC_LOAD_SOURCE, filename );
  328. }
  329.  
  330. int trap_PC_FreeSource( int handle ) {
  331.     return syscall( UI_PC_FREE_SOURCE, handle );
  332. }
  333.  
  334. int trap_PC_ReadToken( int handle, pc_token_t *pc_token ) {
  335.     return syscall( UI_PC_READ_TOKEN, handle, pc_token );
  336. }
  337.  
  338. int trap_PC_SourceFileAndLine( int handle, char *filename, int *line ) {
  339.     return syscall( UI_PC_SOURCE_FILE_AND_LINE, handle, filename, line );
  340. }
  341.  
  342. int trap_PC_LoadGlobalDefines ( const char* filename )
  343. {
  344.     return syscall ( UI_PC_LOAD_GLOBAL_DEFINES, filename );
  345. }
  346.  
  347. void trap_PC_RemoveAllGlobalDefines ( void )
  348. {
  349.     syscall ( UI_PC_REMOVE_ALL_GLOBAL_DEFINES );
  350. }
  351.  
  352. void trap_S_StopBackgroundTrack( void ) {
  353.     syscall( UI_S_STOPBACKGROUNDTRACK );
  354. }
  355.  
  356. void trap_S_StartBackgroundTrack( const char *intro, const char *loop, qboolean bReturnWithoutStarting) {
  357.     syscall( UI_S_STARTBACKGROUNDTRACK, intro, loop, bReturnWithoutStarting );
  358. }
  359.  
  360. int trap_RealTime(qtime_t *qtime) {
  361.     return syscall( UI_REAL_TIME, qtime );
  362. }
  363.  
  364. // this returns a handle.  arg0 is the name in the format "idlogo.roq", set arg1 to NULL, alteredstates to qfalse (do not alter gamestate)
  365. int trap_CIN_PlayCinematic( const char *arg0, int xpos, int ypos, int width, int height, int bits) {
  366.   return syscall(UI_CIN_PLAYCINEMATIC, arg0, xpos, ypos, width, height, bits);
  367. }
  368.  
  369. // stops playing the cinematic and ends it.  should always return FMV_EOF
  370. // cinematics must be stopped in reverse order of when they are started
  371. e_status trap_CIN_StopCinematic(int handle) {
  372.   return syscall(UI_CIN_STOPCINEMATIC, handle);
  373. }
  374.  
  375.  
  376. // will run a frame of the cinematic but will not draw it.  Will return FMV_EOF if the end of the cinematic has been reached.
  377. e_status trap_CIN_RunCinematic (int handle) {
  378.   return syscall(UI_CIN_RUNCINEMATIC, handle);
  379. }
  380.  
  381.  
  382. // draws the current frame
  383. void trap_CIN_DrawCinematic (int handle) {
  384.   syscall(UI_CIN_DRAWCINEMATIC, handle);
  385. }
  386.  
  387.  
  388. // allows you to resize the animation dynamically
  389. void trap_CIN_SetExtents (int handle, int x, int y, int w, int h) {
  390.   syscall(UI_CIN_SETEXTENTS, handle, x, y, w, h);
  391. }
  392.  
  393.  
  394. void trap_R_RemapShader( const char *oldShader, const char *newShader, const char *timeOffset ) 
  395. {
  396.     syscall( UI_R_REMAP_SHADER, oldShader, newShader, timeOffset );
  397. }
  398.  
  399. qboolean trap_VerifyCDKey( const char *key ) 
  400. {
  401.     return syscall( UI_VERIFY_CDKEY, key );
  402. }
  403.  
  404. /*
  405. Ghoul2 Insert Start
  406. */
  407. // CG Specific API calls
  408. void trap_G2_ListModelSurfaces(void *ghlInfo)
  409. {
  410.     syscall( UI_G2_LISTSURFACES, ghlInfo);
  411. }
  412.  
  413. void trap_G2_ListModelBones(void *ghlInfo, int frame)
  414. {
  415.     syscall( UI_G2_LISTBONES, ghlInfo, frame);
  416. }
  417.  
  418. void trap_G2_SetGhoul2ModelIndexes(void *ghoul2, qhandle_t *modelList, qhandle_t *skinList)
  419. {
  420.     syscall( UI_G2_SETMODELS, ghoul2, modelList, skinList);
  421. }
  422.  
  423. int    trap_G2API_AddBolt(void *ghoul2, const int modelIndex, const char *boneName)
  424. {
  425.     return (int) (syscall(UI_G2_ADDBOLT, ghoul2, modelIndex, boneName));
  426. }
  427.  
  428. qboolean trap_G2API_RemoveBolt(void *ghlInfo, const int modelIndex, const int index)
  429. {
  430.     return (qboolean)(syscall(UI_G2_REMOVEBOLT, ghlInfo, modelIndex, index));
  431. }
  432.  
  433. qboolean trap_G2API_AttachG2Model(void *ghoul2From, int modelFrom, void *ghoul2To, int toBoltIndex, int toModel)
  434. {
  435.     return (qboolean)(syscall(UI_G2_ATTACHG2MODEL, ghoul2From, modelFrom, ghoul2To, toBoltIndex, toModel));
  436. }
  437.  
  438. qboolean trap_G2_HaveWeGhoul2Models(    void *ghoul2)
  439. {
  440.     return (qboolean)(syscall(UI_G2_HAVEWEGHOULMODELS, ghoul2));
  441. }
  442.  
  443. qboolean trap_G2API_GetBoltMatrix(void *ghoul2, const int modelIndex, const int boltIndex, mdxaBone_t *matrix,
  444.                                 const vec3_t angles, const vec3_t position, const int frameNum, qhandle_t *modelList, vec3_t scale)
  445. {
  446.     return (qboolean)(syscall(UI_G2_GETBOLT, ghoul2, modelIndex, boltIndex, matrix, angles, position, frameNum, modelList, scale));
  447. }
  448.  
  449. int trap_G2API_InitGhoul2Model(void **ghoul2Ptr, const char *fileName, int modelIndex, qhandle_t customSkin,
  450.                           qhandle_t customShader, int modelFlags, int lodBias)
  451. {
  452.     return syscall(UI_G2_INITGHOUL2MODEL, ghoul2Ptr, fileName, modelIndex, customSkin, customShader, modelFlags, lodBias);
  453. }
  454.  
  455. void trap_G2API_CleanGhoul2Models(void **ghoul2Ptr)
  456. {
  457.     syscall(UI_G2_CLEANMODELS, ghoul2Ptr);
  458. }
  459.  
  460. qboolean trap_G2API_SetBoneAngles(void *ghoul2, int modelIndex, const char *boneName, const vec3_t angles, const int flags,
  461.                                 const int up, const int right, const int forward, qhandle_t *modelList,
  462.                                 int blendTime , int currentTime )
  463. {
  464.     return (syscall(UI_G2_ANGLEOVERRIDE, ghoul2, modelIndex, boneName, angles, flags, up, right, forward, modelList, blendTime, currentTime));
  465. }
  466.  
  467. qboolean trap_G2API_SetBoneAnim(void *ghoul2, const int modelIndex, const char *boneName, const int startFrame, const int endFrame,
  468.                               const int flags, const float animSpeed, const int currentTime, const float setFrame , const int blendTime )
  469. {
  470.     return syscall(UI_G2_PLAYANIM, ghoul2, modelIndex, boneName, startFrame, endFrame, flags, PASSFLOAT(animSpeed), currentTime, PASSFLOAT(setFrame), blendTime);
  471. }
  472.  
  473. char *trap_G2API_GetGLAName(void *ghoul2, int modelIndex)
  474. {
  475.     return (char *)syscall(UI_G2_GETGLANAME, ghoul2, modelIndex);
  476. }
  477.  
  478. int trap_G2API_CopyGhoul2Instance(void *g2From, void *g2To, int modelIndex)
  479. {
  480.     return syscall(UI_G2_COPYGHOUL2INSTANCE, g2From, g2To, modelIndex);
  481. }
  482.  
  483. int trap_G2API_CopySpecifiUIhoul2Model(void *g2From, int modelFrom, void *g2To, int modelTo)
  484. {
  485.     return syscall(UI_G2_COPYSPECIFICGHOUL2MODEL, g2From, modelFrom, g2To, modelTo);
  486. }
  487.  
  488. void trap_G2API_DuplicateGhoul2Instance(void *g2From, void **g2To)
  489. {
  490.     syscall(UI_G2_DUPLICATEGHOUL2INSTANCE, g2From, g2To);
  491. }
  492.  
  493. qboolean trap_G2API_RemoveGhoul2Model(void **ghlInfo, int modelIndex)
  494. {
  495.     return syscall(UI_G2_REMOVEGHOUL2MODEL, ghlInfo, modelIndex);
  496. }
  497.  
  498. qboolean trap_G2API_SetSurfaceOnOff(void *ghoul2, const int modelIndex, const char *surfaceName, const int flags)
  499. {
  500.     return syscall(UI_G2_SETSURFACEONOFF, ghoul2, modelIndex, surfaceName, flags);
  501. }
  502.  
  503. qboolean trap_G2API_GetAnimFileNameIndex ( TGhoul2 ghoul2, qhandle_t modelIndex, const char* filename )
  504. {
  505.     return syscall(UI_G2_GETANIMFILENAMEINDEX, ghoul2, modelIndex, filename );
  506. }
  507.  
  508. qhandle_t trap_G2API_RegisterSkin ( const char *skinName, int numPairs, const char *skinPairs)
  509. {
  510.     return syscall(UI_G2_REGISTERSKIN, skinName, numPairs, skinPairs );
  511. }
  512.  
  513. qboolean trap_G2API_SetSkin ( TGhoul2 ghoul2, int modelIndex, qhandle_t customSkin)
  514. {
  515.     return syscall(UI_G2_SETSKIN, ghoul2, modelIndex, customSkin );
  516. }
  517.  
  518. // CGenericParser2 (void *) routines
  519. TGenericParser2 trap_GP_Parse(char **dataPtr, qboolean cleanFirst, qboolean writeable)
  520. {
  521.     return (TGenericParser2)syscall(UI_GP_PARSE, dataPtr, cleanFirst, writeable);
  522. }
  523.  
  524. TGenericParser2 trap_GP_ParseFile(char *fileName, qboolean cleanFirst, qboolean writeable)
  525. {
  526.     return (TGenericParser2)syscall(UI_GP_PARSE_FILE, fileName, cleanFirst, writeable);
  527. }
  528.  
  529. void trap_GP_Clean(TGenericParser2 GP2)
  530. {
  531.     syscall(UI_GP_CLEAN, GP2);
  532. }
  533.  
  534. void trap_GP_Delete(TGenericParser2 *GP2)
  535. {
  536.     syscall(UI_GP_DELETE, GP2);
  537. }
  538.  
  539. TGPGroup trap_GP_GetBaseParseGroup(TGenericParser2 GP2)
  540. {
  541.     return (TGPGroup)syscall(UI_GP_GET_BASE_PARSE_GROUP, GP2);
  542. }
  543.  
  544.  
  545. // CGPGroup (void *) routines
  546. qboolean trap_GPG_GetName(TGPGroup GPG, char *Value)
  547. {
  548.     return (qboolean)syscall(UI_GPG_GET_NAME, GPG, Value);
  549. }
  550.  
  551. TGPGroup trap_GPG_GetNext(TGPGroup GPG)
  552. {
  553.     return (TGPGroup)syscall(UI_GPG_GET_NEXT, GPG);
  554. }
  555.  
  556. TGPGroup trap_GPG_GetInOrderNext(TGPGroup GPG)
  557. {
  558.     return (TGPGroup)syscall(UI_GPG_GET_INORDER_NEXT, GPG);
  559. }
  560.  
  561. TGPGroup trap_GPG_GetInOrderPrevious(TGPGroup GPG)
  562. {
  563.     return (TGPGroup)syscall(UI_GPG_GET_INORDER_PREVIOUS, GPG);
  564. }
  565.  
  566. TGPGroup trap_GPG_GetPairs(TGPGroup GPG)
  567. {
  568.     return (TGPGroup)syscall(UI_GPG_GET_PAIRS, GPG);
  569. }
  570.  
  571. TGPGroup trap_GPG_GetInOrderPairs(TGPGroup GPG)
  572. {
  573.     return (TGPGroup)syscall(UI_GPG_GET_INORDER_PAIRS, GPG);
  574. }
  575.  
  576. TGPGroup trap_GPG_GetSubGroups(TGPGroup GPG)
  577. {
  578.     return (TGPGroup)syscall(UI_GPG_GET_SUBGROUPS, GPG);
  579. }
  580.  
  581. TGPGroup trap_GPG_GetInOrderSubGroups(TGPGroup GPG)
  582. {
  583.     return (TGPGroup)syscall(UI_GPG_GET_INORDER_SUBGROUPS, GPG);
  584. }
  585.  
  586. TGPValue trap_GPG_FindSubGroup(TGPGroup GPG, const char *name)
  587. {
  588.     return (TGPValue)syscall(UI_GPG_FIND_SUBGROUP, GPG, name);
  589. }
  590.  
  591. TGPValue trap_GPG_FindPair(TGPGroup GPG, const char *key)
  592. {
  593.     return (TGPValue)syscall(UI_GPG_FIND_PAIR, GPG, key);
  594. }
  595.  
  596. qboolean trap_GPG_FindPairValue(TGPGroup GPG, const char *key, const char *defaultVal, char *Value)
  597. {
  598.     return (qboolean)syscall(UI_GPG_FIND_PAIRVALUE, GPG, key, defaultVal, Value);
  599. }
  600.  
  601.  
  602. // CGPValue (void *) routines
  603. qboolean trap_GPV_GetName(TGPValue GPV, char *Value)
  604. {
  605.     return (qboolean)syscall(UI_GPV_GET_NAME, GPV, Value);
  606. }
  607.  
  608. TGPValue trap_GPV_GetNext(TGPValue GPV)
  609. {
  610.     return (TGPValue)syscall(UI_GPV_GET_NEXT, GPV);
  611. }
  612.  
  613. TGPValue trap_GPV_GetInOrderNext(TGPValue GPV)
  614. {
  615.     return (TGPValue)syscall(UI_GPV_GET_INORDER_NEXT, GPV);
  616. }
  617.  
  618. TGPValue trap_GPV_GetInOrderPrevious(TGPValue GPV)
  619. {
  620.     return (TGPValue)syscall(UI_GPV_GET_INORDER_PREVIOUS, GPV);
  621. }
  622.  
  623. qboolean trap_GPV_IsList(TGPValue GPV)
  624. {
  625.     return (qboolean)syscall(UI_GPV_IS_LIST, GPV);
  626. }
  627.  
  628. qboolean trap_GPV_GetTopValue(TGPValue GPV, char *Value)
  629. {
  630.     return (qboolean)syscall(UI_GPV_GET_TOP_VALUE, GPV, Value);
  631. }
  632.  
  633. TGPValue trap_GPV_GetList(TGPValue GPV)
  634. {
  635.     return (TGPValue)syscall(UI_GPV_GET_LIST, GPV);
  636. }
  637.  
  638. void trap_Parental_Update ( void )
  639. {
  640.     syscall ( UI_PARENTAL_UPDATE );
  641. }
  642.  
  643. void trap_Parental_SetPassword ( const char* password )
  644. {
  645.     syscall ( UI_PARENTAL_SET_PASSWORD, password );
  646. }
  647.  
  648. void trap_Parental_GetPassword ( char* password, int buffersize )
  649. {
  650.     syscall ( UI_PARENTAL_GET_PASSWORD, password, buffersize );
  651. }
  652.  
  653. void *trap_VM_LocalAlloc ( int size )
  654. {
  655.     return (void *)syscall ( UI_VM_LOCALALLOC, size );
  656. }
  657.  
  658. void *trap_VM_LocalAllocUnaligned ( int size )
  659. {
  660.     return (void *)syscall ( UI_VM_LOCALALLOCUNALIGNED, size );
  661. }
  662.  
  663. void *trap_VM_LocalTempAlloc( int size )
  664. {
  665.     return (void *)syscall ( UI_VM_LOCALTEMPALLOC, size );
  666. }
  667.  
  668. void trap_VM_LocalTempFree( int size )
  669. {
  670.     syscall ( UI_VM_LOCALTEMPFREE, size );
  671. }
  672.  
  673. const char *trap_VM_LocalStringAlloc ( const char *source )
  674. {
  675.     return (const char *)syscall ( UI_VM_LOCALSTRINGALLOC, source );
  676. }
  677.  
  678. qboolean trap_NET_Available(void)
  679. {
  680.     return (qboolean)syscall ( UI_NET_AVAILABLE );
  681. }
  682.  
  683. void trap_Version_GetDescription(char *description, int length)
  684. {
  685.     syscall (UI_VERSION_GET_DESCRIPTION, description, length);
  686. }
  687.  
  688. int trap_Version_GetNumSites(void)
  689. {
  690.     return (int)syscall (UI_VERSION_GET_NUM_SITES);
  691. }
  692.  
  693. void trap_Version_GetSite(int index, char *site, int length)
  694. {
  695.     syscall(UI_VERSION_GET_SITE, index, site, length);
  696. }
  697.  
  698. void trap_Version_Download(int index)
  699. {
  700.     syscall(UI_VERSION_DOWNLOAD, index);
  701. }
  702.